home *** CD-ROM | disk | FTP | other *** search
/ Mixa 155: Dogs / MIXA 155: Dogs.iso / pc / Viewer / BROWSER(W) / フィルタ / PDF / LIB / gs_trap.ps < prev    next >
Encoding:
Text File  |  2002-10-29  |  2.6 KB  |  94 lines

  1. %    Copyright (C) 1999, 2000 Aladdin Enterprises.  All rights reserved.
  2. % This software is licensed to a single customer by Artifex Software Inc.
  3. % under the terms of a specific OEM agreement.
  4.  
  5. % $RCSfile: gs_trap.ps,v $ $Revision: 1.4 $
  6. % PostScript LanguageLevel 3 in-RIP trapping support.
  7.  
  8. ll3dict begin
  9.  
  10. % We need LanguageLevel 2 or higher in order to have setuserparams and
  11. % defineresource.
  12. languagelevel dup 2 max .setlanguagelevel
  13.  
  14. % ------ Trapping ------ %
  15.  
  16. % The PostScript-level trapping parameters are maintained in userdict,
  17. % and explicitly reinstalled upon restore.
  18.  
  19. /Trapping mark
  20.  
  21. /settrapparams dup {        % <paramdict> settrapparams -
  22.   /.trapparams .uservar dup length dict .copydict
  23.   dup 2 index {
  24.             % Stack: paramdict olddict olddict key value
  25.     2 index 2 index known { put dup } { pop pop } ifelse
  26.   } forall pop
  27.   dup .settrapparams    % Let the operator check parameter validity.
  28.   .userdict /.trapparams 3 -1 roll put pop
  29. } bind .makeoperator
  30.  
  31. /.copyparams {        % <obj> .copyparams <obj'>
  32.   dup type /dicttype eq {
  33.     dup length dict .copydict
  34.     dup {
  35.       .copyparams 3 copy put pop pop
  36.     } forall
  37.   } {
  38.     dup type /arraytype eq {
  39.       [ exch { .copyparams } forall ]
  40.     } if
  41.   } ifelse
  42. } odef
  43.  
  44. /currenttrapparams dup {    % - currenttrapparams <paramdict>
  45.   /.trapparams .uservar .copyparams
  46. } bind .makeoperator
  47.  
  48. /settrapzone dup {        % - settrapzone -
  49.     % ****** DUMMY ******
  50.   newpath
  51. } bind .makeoperator
  52.  
  53. % Define initial (dummy) trapping parameters.
  54. % These values are mostly complete guesses.
  55. userdict /.trapparams mark
  56.   /BlackColorLimit 1.0
  57.   /BlackDensityLimit 1.0
  58.   /BlackWidth 1.0
  59.   /ColorantZoneDetails 0 dict
  60.   /Enabled true
  61.   /HalftoneName null
  62.   /ImageInternalTrapping false
  63.   /ImagemaskTrapping true
  64.   /ImageResolution 1
  65.   /ImageToObjectTrapping true
  66.   /ImageTrapPlacement /Center
  67.   /SlidingTrapLimit 1.0
  68.   /StepLimit 1.0
  69.   /TrapColorScaling 0.0
  70.   /TrapSetName null
  71.   /TrapWidth 1.0
  72. .dicttomark readonly put
  73.  
  74. .dicttomark /ProcSet defineresource pop
  75.  
  76. % Define the InkParams and TrapParams resource categories.
  77. { /InkParams /TrapParams } {
  78.   /Generic /Category findresource dup maxlength 3 add dict .copydict begin
  79.     /InstanceType /dicttype def
  80.   currentdict end /Category defineresource pop
  81. } forall
  82.  
  83. % Define the TrappingType resource category.
  84. /Generic /Category findresource dup maxlength 3 add dict .copydict begin
  85.   /InstanceType /integertype def
  86. /TrappingType currentdict end /Category defineresource pop
  87.  
  88. {1001} { dup /TrappingType defineresource pop } forall
  89.  
  90. .setlanguagelevel
  91.  
  92. end            % ll3dict
  93.